package com.yufei.infoExtractor.io;


import com.yufei.infoExtractor.io.impl.CommonDataRetriever;

import com.yufei.infoExtractor.io.impl.HttpDataRetrieverUsingWebkit;

public class DataRetrieverFactory {
public static HttpDataRetriever  createDataRetriever(DataRetrieverFeatures dataRetrieverFeatures){
	HttpDataRetriever dataRetriever=null;
	if(dataRetrieverFeatures==null){
		throw new IllegalArgumentException("dataRetrieverFeatures can not be null!");
	}
	if(dataRetrieverFeatures.getRequestExecuteJs()==null){
		throw new IllegalArgumentException("IsRequestExecuteJs can not be null!");
	}
		if(dataRetrieverFeatures.getRequestExecuteJs()){
			dataRetriever=new HttpDataRetrieverUsingWebkit(dataRetrieverFeatures);

			
		}
		else{
			dataRetriever=new CommonDataRetriever(dataRetrieverFeatures);
					
		}
	
	
      
	
	
	return dataRetriever;
}
}
